﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'PRC_TB_USER_TASK_HISTORY_IN')
	BEGIN
		DROP  Procedure  dbo.PRC_TB_USER_TASK_HISTORY_IN
	END

GO

create procedure [dbo].[PRC_TB_USER_TASK_HISTORY_IN]
(
@TUH_USER_ID int,
@TUH_TASK_ID int,
@TUH_PROJECT varchar(80),
@TUH_NAME varchar(100),
@TUH_START_DATE datetime,
@TUH_END_DATE datetime,
@TUH_HOURS_DAY int,
@TUH_DESCRIPTION varchar(2000),
@TUH_TYPE int,
@TUH_CHANGE_REQUEST_ID int,
@TUH_CHANGE_REQUEST_RESULT_ID int,
@TUH_CLASSIFICATION_ID int
)
as
	insert into TB_USER_TASK_HISTORY
	(TUH_USER_ID,
	 TUH_TASK_ID,
	 TUH_PROJECT,
	 TUH_NAME,
	 TUH_START_DATE,
	 TUH_END_DATE,
	 TUH_HOURS_DAY,
	 TUH_DESCRIPTION,
	 TUH_TYPE,
	 TUH_CHANGE_REQUEST_ID,
	 TUH_CHANGE_REQUEST_RESULT_ID,
	 TUH_CLASSIFICATION_ID)
	values
	(@TUH_USER_ID,
	 @TUH_TASK_ID,
	 @TUH_PROJECT,
	 @TUH_NAME,
	 @TUH_START_DATE,
	 @TUH_END_DATE,
	 @TUH_HOURS_DAY,
	 @TUH_DESCRIPTION,
	 @TUH_TYPE,
	 @TUH_CHANGE_REQUEST_ID,
	 @TUH_CHANGE_REQUEST_RESULT_ID,
	 @TUH_CLASSIFICATION_ID)

select @@identity

GO

GRANT EXEC ON dbo.PRC_TB_USER_TASK_HISTORY_IN TO PUBLIC

GO

